package com.wu.staticdemo1;

public class A {
    //1.懒汉式单例
    private static A a;

    //2.私有构造器
    private A(){

    }

    //3.定义一个方法，保证唯一

    private static A getInstance(){
        if(a==null){
           a=new A();
        }
        return a;
    }


}
